<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: register.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."register.php";
include LOCALE.LOCALESET."user_fields.php";

$query="SELECT klasse FROM oppkjoring";
$result=mysql_query($query);

$options="";

while ($row=mysql_fetch_array($result)) {
    $klasse=$row["klasse"];
    $options.="<OPTION VALUE=\"$klasse\">".$klasse;
}

$avloserid=$_GET['avloserid'];
$db = mysql_connect($GLOBALS['db_host'], $GLOBALS['db_user'], $GLOBALS['db_password']);
mysql_select_db($GLOBALS['db_name'], $db); 

$query=" SELECT * FROM avloser WHERE avloserid='$avloserid'";
$result=mysql_query($query);
$num1=mysql_numrows($result);

$i=0;
while ($i < $num1) {
$fornavn=mysql_result($result,$i,"fornavn");
$etternavn=mysql_result($result,$i,"etternavn");
++$i;
}

$query=" SELECT avloserid FROM avloser WHERE avloserid='$avloserid'";
$result=mysql_query($query);
$num=mysql_numrows($result);

$i=0;
while ($i < $num) {
$avloserid=mysql_result($result,$i,"avloserid");
++$i;
}

echo "<br></br><table class='capmain' border='0' cellpadding='0' align='center' width='608px'>
<tr><th><font style='text-transform: capitalize;'>Oppkj&oslash;rings info for $fornavn  $etternavn </font></th></tr></table>";

echo "<form action='oppkjoring_reg.php' method='post'>";
echo "<input type='hidden' name='ud_avloserid' value=$avloserid>";
echo "<table class='imagetable' cellpadding='0' cellspacing='0' align='center'>\n<tr>";
echo "<th>Oppkj&oslash;ringsID:</th>"; 
echo "<td><input type='hidden' name='avloseroppkjoringsid' value='$avloserid' maxlength='30' style='width:200px;' /></td>";
echo "</tr>\n<tr>\n";
echo "<th>Avl&oslash;serID:</th>";
echo "<td><input type='hidden' name='avloserid' value='$avloserid' maxlength='30' style='width:200px;' /></td>";
echo "</tr>\n<tr>\n";
echo "<th>&Aring;r:</th>";
echo "<td><input type='text' name='aar' maxlength='20' style='width:200px;' /></td>";
echo "</tr>\n<tr>\n";
echo "<th>Klasse:</th>";
echo "<td><input type='text' name='klasse' maxlength='30' style='width:200px;' /></td>";
echo "</tr>\n<tr>\n";
echo "<th>Har hatt oppkj&oslash;ring:</th>";
echo "<td> <SELECT NAME='oppkjoring_klasse[]'><OPTION VALUE=0>$options</SELECT><SELECT NAME='oppkjoring_klasse[]'><OPTION VALUE=0>$options</SELECT><SELECT NAME='oppkjoring_klasse[]'><OPTION VALUE=0>$options</SELECT><SELECT NAME='oppkjoring_klasse[]'><OPTION VALUE=0>$options</SELECT><SELECT NAME='oppkjoring_klasse[]'><OPTION VALUE=0>$options</SELECT><SELECT NAME='oppkjoring_klasse[]'><OPTION VALUE=0>$options</SELECT></td>";
echo "</tr>\n<tr>\n";
echo "<th><input type='Submit' value='Lagre'>";;
echo "<td></td>\n";
echo "</tr>\n<tr>\n</table><br></br>";

require_once THEMES."templates/footer.php";
?>